package com.huawei.esdk.tp.domain.model;

import com.huawei.esdk.platform.common.SDKResult;
import com.huawei.esdk.platform.common.exception.SDKException;
import com.huawei.esdk.platform.common.utils.ApplicationContextUtil;
import com.huawei.esdk.platform.nemgr.itf.IDeviceManager;
import com.huawei.esdk.tp.common.constants.TPConstant;
import com.huawei.esdk.tp.device.smc.v100r003c10.SMC20V1R3C10IConferenceManagerCapability;
import com.huawei.esdk.tp.domain.model.bean.MultiPointCDRQueryConfig;
import com.huawei.esdk.tp.domain.model.bean.MultiPointCDRResult;
import com.huawei.esdk.tp.domain.model.bean.PagedList;
import com.huawei.esdk.tp.domain.model.bean.PointToPointCDR;
import com.huawei.esdk.tp.domain.model.bean.PointToPointCDRQueryConfig;

public class CDRInformation
{
    private static IDeviceManager deviceManager = (IDeviceManager)ApplicationContextUtil.getBean("deviceManager");
    
    public static IDeviceManager getDeviceManager()
    {
        return deviceManager;
    }
    
    public static void setDeviceManager(IDeviceManager deviceManager)
    {
        CDRInformation.deviceManager = deviceManager;
    }
    
    public static SDKResult<MultiPointCDRResult> queryMultiPointCDREx(MultiPointCDRQueryConfig queryConfig)
        throws SDKException
    {
        SMC20V1R3C10IConferenceManagerCapability confMgr =
            deviceManager.getDeviceServiceProxy(TPConstant.DEV_ID_SMC, SMC20V1R3C10IConferenceManagerCapability.class);
        return confMgr.queryMultiPointCDREx(queryConfig);
    }
    
    public static SDKResult<PagedList<PointToPointCDR>> queryPointToPointCDR(PointToPointCDRQueryConfig queryConfig)
        throws SDKException
    {
        SMC20V1R3C10IConferenceManagerCapability confMgr =
            deviceManager.getDeviceServiceProxy(TPConstant.DEV_ID_SMC, SMC20V1R3C10IConferenceManagerCapability.class);
        SDKResult<PagedList<PointToPointCDR>> result =
            confMgr.queryPointToPointCDR(queryConfig);
        return result;
    }
}
